<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body>
    <div id="app">
        <ul>
            <li v-for="item of arr">{{item}}</li>
            <button @click="change">{{arr}}</button>
        </ul>
    </div>
</body>
</html>
<script>
    const { createApp } = Vue
    const app = createApp({
        data(){
            return{
                arr:[1,3,4,5,6,2,4,1,7,8]
            }
        },
        methods:{
            change(){
                // this.arr.pop()
                // this.arr.push(123)
                // this.arr.reverse()//将数组中的元素颠倒
                this.arr.splice(0,1,3)//数组的截取与添加
            }
        }
    })
    app.mount('#app')
</script>